<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>滴答办公系统-学院新增</title>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport"
	content="width=device-width, initial-scale=1, maximum-scale=1">
<link rel="stylesheet" href="media/layui/css/layui.css" media="all">
<script type="text/javascript" src="media/js/jquery.min.js"></script>
</head>
<body>

	<div class="layui-container" style="margin-top: 50px;margin-left: 15%;">
		<form class="layui-form" action="studentadd.do" method="post">
			<div class="layui-form-item">
				<label class="layui-form-label">学号</label>
				<div class="layui-input-inline">
					<input type="text" name="no" lay-verify="name" autocomplete="off"
						placeholder="请输入学号" class="layui-input">
				</div>
				<label class="layui-form-label">姓名</label>
				<div class="layui-input-inline">
					<input type="text" name="name" lay-verify="name" autocomplete="off"
						placeholder="请输入姓名" class="layui-input">
				</div>
				
			</div>
			<div class="layui-form-item">
			<label class="layui-form-label">出生日期</label>
				<div class="layui-input-inline">
					<input type="text" name="birthday" id="date" autocomplete="off"
						class="layui-input" placeholder="请选择生日">
				</div>
				<label class="layui-form-label">性别</label>
				<div class="layui-input-inline">
					<input type="radio" name="sex" value="男" title="男" checked> <input
						type="radio" name="sex" value="女" title="女" >
				</div>
			</div>
			<div class="layui-form-item">
				
				<label class="layui-form-label">身份证号</label>
				<div class="layui-input-inline">
					<input type="number" name="cardno" lay-verify="name"
						autocomplete="off" placeholder="请输入身份证号" class="layui-input">
				</div>
				<label class="layui-form-label">班级</label>
				<div class="layui-input-inline">
					<select name="cno" lay-verify="required" id="d1">
						<option value=""></option>
					</select>
				</div>
			</div>
			
			<div class="layui-form-item">
				<label class="layui-form-label">学校</label>
				<div class="layui-input-inline">
					<input type="text" name="schoolname" lay-verify="name"
						autocomplete="off" placeholder="请输入学校名" class="layui-input">
				</div>
				<label class="layui-form-label">学历</label>
				<div class="layui-input-inline">
					<input type="text" name="education" lay-verify="name"
						autocomplete="off" placeholder="请输入学历" class="layui-input">
				</div>
			</div>

			<div class="layui-form-item">
				<label class="layui-form-label">手机号</label>
				<div class="layui-input-inline">
					<input type="number" name="phone" lay-verify="name"
						autocomplete="off" placeholder="请输入手机号" class="layui-input">
				</div>
				<label class="layui-form-label">邮箱</label>
				<div class="layui-input-inline">
					<input type="text" name="email" lay-verify="name"
						autocomplete="off" placeholder="请输入邮箱" class="layui-input">
				</div>
				
			</div>

			<div class="layui-form-item">
			<label class="layui-form-label">QQ号</label>
				<div class="layui-input-inline">
					<input type="number" name="qq" lay-verify="name"
						autocomplete="off" placeholder="请输入qq号" class="layui-input">
				</div>
				<label class="layui-form-label">介绍人</label>
				<div class="layui-input-inline">
					<input type="text" name="introno" lay-verify="name"
						autocomplete="off" placeholder="请输入介绍人" class="layui-input">
				</div>
			</div>
			<div class="layui-form-item" >
			<div class="layui-input-block" style="left: 35%;margin-top: 20px;">
					<input class="layui-btn" type="submit" value="确认新增">
			</div>
		
			</div>
		</form>
	</div>


	<script src="media/layui/layui.js"></script>
	<!-- 注意：如果你直接复制所有代码到本地，上述js路径需要改成你本地的 -->
	<script>
	var form;
		layui.use([ 'form', 'laydate' ],
						function() {
							form = layui.form, layer = layui.layer, laydate = layui.laydate;
							//日期
							laydate.render({
								elem : '#date'
							});
							//自定义验证规则
							form.verify({
								title : function(value) {
									if (value.length < 5) {
										return '标题至少得5个字符啊';
									}
								},
								pass : [ /(.+){6,12}$/, '密码必须6到12位' ],
								content : function(value) {
									layedit.sync(editIndex);
								}
							});
							initData()
						});
		function initData() {
			$.get("gradeall.do", null, function(arr) {
				for (i = 0; i < arr.length; i++) {
					$("#d1").append(
							"<option value='"+arr[i].id+"'>" + arr[i].name
									+ "</option>");
				}
				form.render("select");
			});
		}
	</script>
</body>
</html>